/*This is the linked list part*/
#include<stdio.h>

   struct global_node
   {
      int value;
      struct global_node *next;
   }
   
struct global_node *first=NULL;
   
struct global_node* enter(struct global_node *first,int n)
{

    struct global_node *new_node;       
    new_node=malloc(sizeof(struct global_node));
    
    if(new_node==NULL)
    {
       printf("No list :");
    }
    
    
    new_node->value=n;
    first=new_node;       
    new_node->next=first;
    return *first;
  
}












int main()
{
   int c,i,n,a;

   
   printf("enter the number of elements u want to enter :");
   scanf("%d",&a);
   if(a==0)
   {
      return first;
   }
   printf("enter the elements :");
   for(i=0;i<a;i++)
   {
       scanf("%d",&n);
       first=enter(first,n);
   }
   printf("1=append 2=extend 3=insert 4=indexing 5=pop 6=delete 7=reverse 8=count 9=sort");
   scanf("%d",&c);
   switch(c)
   {
       case 1 :append(first);
               break;
       case 2 :extend(first);
               break;
       case 3 :insert(first);
               break;
       case 4 :indexing(first);
               break;
       case 5 :pop(first);
               break;
       case 6 :delete(first);
               break;
       case 7 :reversal(first);
               break;
       case 8 :count(first);
               break;
       case 9 :sort(first);
                break; 
   }
   return 0; 
}

